<?php
include_once('common/header.php');			
if($AppUI->id <=0 || !isset($_SERVER['HTTP_REFERER'])) {
	Vfriend_Function::redirect(HOST_VFRIEND);
}
$strTitle 		= $objRequest->getParam('ptitle', '');
$intCategoryId	= $objRequest->getParam('pcategoryid', 0);
$intProvince	= $objRequest->getParam('pprovince', 0);
$strMobile		= $objRequest->getParam('pmobile', '');
$strRefer		= isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : LINK_OFFLINE;
$intError		= 0;
if($strTitle == '') $intError = 1;
elseif($strTitle != '' && strlen($strTitle) < 5) $intError = 2;
elseif($intCategoryId == 0) $intError = 3;
elseif($intProvince == '' || $intProvince == 0) $intError=7;
elseif($strMobile == '') $intError=27;
if($intError == 0) {	
	$objOffline	= new Offline();
	$intError	= $objOffline->addQuick($AppUI->id, $intCategoryId, $strTitle, $intProvince, $strMobile, $intOfflineId);
	if($intError == 0) {
		$strLink = Vfriend_Function::linkOfflineForDetail($intOfflineId, $strTitle);
		Vfriend_Function::setMsg($arrMessage[1]);
		Vfriend_Function::redirect($strLink);
	} else {
		$intError = 12;
	}
}
if($intError > 0) {	
	Vfriend_Function::setError($arrError[$intError]);
}
Vfriend_Function::redirect($strRefer);
?>